//LAYOUT

	    layout = $('body').layout({
                    applyDefaultStyles: true,
                    onopen_end : function(){
                        var state = layout.state;
                        //alert(!state.west.isClosed);
                        if(state.west.isClosed)
                            $.cookie('hideWest', 'true');
                        else
                            $.cookie('hideWest', 'false');

                        if(state.north.isClosed)
                            $.cookie('hideNorth', 'true');
                        else
                            $.cookie('hideNorth', 'false');

                        if(state.south.isClosed)
                            $.cookie('hideSouth', 'true');
                        else
                            $.cookie('hideSouth', 'false');

                    },
                    onclose_end : function(){
                        var state = layout.state;
                        //alert(!state.west.isClosed);
                        if(state.west.isClosed)
                            $.cookie('hideWest', 'true');
                        else
                            $.cookie('hideWest', 'false');

                        if(state.north.isClosed)
                            $.cookie('hideNorth', 'true');
                        else
                            $.cookie('hideNorth', 'false');

                        if(state.south.isClosed)
                            $.cookie('hideSouth', 'true');
                        else
                            $.cookie('hideSouth', 'false');

                    }
                });
                hideWest = $.cookie("hideWest");
                if(hideWest==undefined){
                    hideWest = 'false';
                    $.cookie('hideWest', 'true');
                }
                else{
                    if(hideWest=='true'){
                        layout.close('west');
                    }
                    else if(hideWest=='false')
                    {
                        layout.open('west');
                    }
                }

                hideNorth = $.cookie("hideNorth");
                if(hideNorth==undefined){
                    hideNorth = 'false';
                    $.cookie('hideNorth', 'true');
                }
                else{
                    if(hideNorth=='true'){
                        layout.close('north');
                    }
                    else if(hideNorth=='false')
                    {
                        layout.open('north');
                    }
                }



                hideSouth = $.cookie("hideSouth");
                if(hideWest==undefined){
                    hideSouth = 'false';
                    $.cookie('hideSouth', 'true');
                }
                else{
                    if(hideSouth=='true'){
                        layout.close('south');
                    }
                    else if(hideSouth=='false')
                    {
                        layout.open('south');
                    }
                }

//LAYOUT END


                //VERTICAL MENU
                setTimeout(function() {
                    $('#horizontalmenu > li > a.expanded + ul').slideToggle('medium');
                    $('#horizontalmenu > li > a').click(function() {
                        $('#horizontalmenu > li > a.expanded').not(this).toggleClass('expanded').toggleClass('collapsed').parent().find('> ul').slideToggle('medium');
                        $(this).toggleClass('expanded').toggleClass('collapsed').parent().find('> ul').slideToggle('medium');
                    });
                }, 250);
                //VERTICAL MENU END







                //TOP MENU
                $('#nav li').click(
                function () {
                    //show its submenu
                    $('ul', this).slideDown(100);
                }
            );
                $('#nav li').hover(
                function () {},
                function () {
                    //hide its submenu
                    $('ul', this).slideUp(100);

                }
            );
                //TOP MENU END


	//AJAX BLOCKING
	$(document).ajaxStart($.blockUI).ajaxStop($.unblockUI);
	
	//AJAX BLOCKING END
	
	//Message
	 $("#infoMessages").floatingMessage( {  
         align:"right", 
		 verticalAlign:"bottom", 
		 time:3000  
     });
	//Message end